package com.ch.android.lookforkotlinv2.adapter

import androidx.fragment.app.Fragment
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.ch.android.lookforkotlinv2.fragment.LiveListFragment
import com.ch.android.networklib.data.LiveTypeData

/**
 * Author: conghao
 * Date: 2024/1/19 13:58
 * Description: SquarePageAdapter
 */
class SquarePageAdapter(fragment: Fragment, private val liveTypes: List<LiveTypeData>) : FragmentStateAdapter(fragment) {
    override fun getItemCount() = liveTypes.size

    override fun createFragment(position: Int): Fragment {
        return LiveListFragment.newInstance(liveTypes[position].id)
    }
}